[AI-GEN] Improve Lighthouse scores: performance, accessibility and best practices #44
+580
−121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
A Lighthouse pass over the app, fixing everything that is fixable without an HTTPS certificate. Performance went from 0.67 to 0.93 and accessibility from 0.93 to 1.00, with every layout shift and the LCP regression removed.
Scores (mobile, LAN preview, before → after)
* The actual audits improved, but the category is dominated by two audits worth 10 of the 20 available points —
is-on-httpsanddeprecations(Chrome's private-network deprecation) — which both require HTTPS. Excluding the HTTPS-capped audits the score is 0.94.image-size-responsivealso still fails because OSM only serves 256 px tiles; fixing it would mean switching tile provider.Other routes
The city list and venue detail routes were audited too:
//:cityId/venues/:cityId/venues/:venueIdBoth routes fetched the venue list after hydration and painted a
Loading…shell, so the page grew and pushed the footer down. They now prefetch the shared query in their route loader (SSR renders the real content, footer never moves), and the venue map renders a server-side street-grid skeleton — inlined SVG, no extra request — under the live map so a late map tile no longer wins the LCP race.Changes
Performance
<link rel="preload">, removing the Google Fonts round trips. Metric-adjusted local Georgia fallbacks prevent reflow on swap.ClientMap/ClientVenueMap, so they only load when a map mounts.map-poster.avif, 29 KB) is preloaded withfetchpriority="high"; the live map fades in on top of it so Chrome keeps the poster as the LCP candidate.react-leaflet-cluster) — fewer markers, fewer tiles, comfortable touch targets.favicon.icokeeps its artwork at 16/32/48 px while dropping from 100 KB to 8.8 KB.Accessibility
main#main-contentand a singleh1per page.--header-inktoken so contrast passes AA in both themes (the upstreamcream-darkvalue still failed in dark mode).color-contrastandtarget-sizenow pass (1.00).Correctness / UX
data-mock-locationflag on<html>(set by an inline script, applied via CSS) decides whether it takes up space — no more post-hydration push-down.opacity: 0, which previously made Chrome ignore the map poster as an LCP candidate.theme-coloradded for SEO and link previews.Verification
tsc --noEmit,vitest(50/50),eslint .,prettier --check .all pass.http://10.64.124.169:3111/project2/) with Chrome headless; results stable across runs.mainafter Style fixes #41 (Style fixes); onlyHeader.tsxandstyles.cssconflicted. Kept the contrast-safe header markup (plus upstream'sz-1000) and both CSS blocks (upstream's Leafletz-index: 900and the cluster styles).Notes
lighthouse.json) stays local and is only added to.prettierignore./project2base path, design and behaviour are unchanged.AI declaration & final notes
auto-prfound in.agents/skills/auto-pr/SKILL.md